package com.iptv.grape.ui.control.task;

import android.os.AsyncTask;


import com.iptv.grape.net.Entity.RecommendData;
import com.iptv.grape.net.NetworkService;
import com.iptv.grape.ui.frgmt.RecommendFragment;

import java.util.List;

public class RecommendTask extends AsyncTask<Object, Void, List<RecommendData>> {

    RecommendFragment uiFragment;
    @Override
    protected List<RecommendData> doInBackground(Object[] params) {
        uiFragment= (RecommendFragment)params[0];
        List<RecommendData> list = NetworkService.getInstance().getLiveRecommendData();

        return list;
    }

    @Override
    protected void onPostExecute(List<RecommendData> result) {
        if(result != null && result.size() > 0) {
            uiFragment.initUI(result);
        }
    }
}
